package com.tree.backend.controller;

import com.tree.backend.common.Result;
import com.tree.backend.entity.vo.OrgDistributionData;
import com.tree.backend.service.IPartyOrganizationService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 党组织基本信息表，记录企业内各级党组织的基本信息 前端控制器
 * </p>
 *
 * @author tree
 * @since 2025-10-15
 */
@RestController
@RequiredArgsConstructor
@RequestMapping("/party-organization")
public class PartyOrganizationController {

    private final IPartyOrganizationService partyOrganizationService;


    @GetMapping("/distribution")
    public Result<List<OrgDistributionData>> distribution() {
        return Result.success(partyOrganizationService.distribution());
    }
}
